3 # this demoscript illustrates how to tie a callback to activating or clicking away of the window.
9 self
.w
= W
.Window((200, 200), 'Activate demo')
10 self
.w
.bind("<activate>", self
.my_activate_callback
)
13 def my_activate_callback(self
, onoff
):
14 '''the callback gets 1 parameter which indicates whether the window
15 has been activated (1) or clicked to the back (0)'''
17 print "I'm in the front now!"
19 print "I've been clicked away, Oh No!"